package com.medical.controller;

import com.medical.pojo.UsageRing;
import com.medical.pojo.UsageVO;
import com.medical.service.UsageRingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/usageRing")
public class UsageRingController {

    @Autowired
    private UsageRingService usageRingService;

    @RequestMapping("/list")
    public List<UsageRing> list(@RequestBody UsageVO usageVO){
        return usageRingService.list(usageVO);
    }

    @RequestMapping("/findCurrentUsage")
    public List<String > findCurrentUsage(@RequestBody UsageVO usageVO){
        return usageRingService.findCurrentUsage(usageVO);
    }

    @RequestMapping("/findPreviousUsage")
    public List<String > findPreviousUsage(@RequestBody UsageVO usageVO){
        return usageRingService.findPreviousUsage(usageVO);
    }

    @RequestMapping("/findRingResults")
    public List<Integer> findRingResults(@RequestBody UsageVO usageVO){
        return usageRingService.findRingResults(usageVO);
    }
}
